package aptech.eproject.logictics.db;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the TRIP_PACKAGE database table.
 * 
 */
@Embeddable
public class TripPackagePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private int packageId;
	private int tripId;

    public TripPackagePK(int packageId,int tripId) {
        this.packageId = packageId;
        this.tripId = tripId;
    }

    public TripPackagePK() {
    }

    
    

	@Column(name="PACKAGE_ID")
	public int getPackageId() {
		return this.packageId;
	}
	public void setPackageId(int packageId) {
		this.packageId = packageId;
	}

	@Column(name="TRIP_ID")
	public int getTripId() {
		return this.tripId;
	}
	public void setTripId(int tripId) {
		this.tripId = tripId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TripPackagePK)) {
			return false;
		}
		TripPackagePK castOther = (TripPackagePK)other;
		return 
			(this.packageId == castOther.packageId)
			&& (this.tripId == castOther.tripId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.packageId;
		hash = hash * prime + this.tripId;
		
		return hash;
    }
}